<html>
<head><meta charset="utf-8"><title>Span of `&amp;[mut]` from an `AddrOf` expr? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20of.20.60.26.5Bmut.5D.60.20from.20an.20.60AddrOf.60.20expr.3F.html">Span of `&amp;[mut]` from an `AddrOf` expr?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227331189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Span%20of%20%60%26%5Bmut%5D%60%20from%20an%20%60AddrOf%60%20expr%3F/near/227331189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20of.20.60.26.5Bmut.5D.60.20from.20an.20.60AddrOf.60.20expr.3F.html#227331189">(Feb 22 2021 at 20:21)</a>:</h4>
<p>I can get the span of <code>&amp;</code> of an <code>AddrOf</code> expression with <code>shrink_to_lo</code>, but is there a method that works when <code>AddrOf</code> is for <code>&amp;mut</code> so that it'll give me the span of <code>&amp;mut</code> and not just the <code>&amp;</code> part?</p>



<a name="227331610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Span%20of%20%60%26%5Bmut%5D%60%20from%20an%20%60AddrOf%60%20expr%3F/near/227331610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20of.20.60.26.5Bmut.5D.60.20from.20an.20.60AddrOf.60.20expr.3F.html#227331610">(Feb 22 2021 at 20:24)</a>:</h4>
<p>I guess I can get the whole span, then update hi to lo of the inner expression?</p>



<a name="227374769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Span%20of%20%60%26%5Bmut%5D%60%20from%20an%20%60AddrOf%60%20expr%3F/near/227374769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Span.20of.20.60.26.5Bmut.5D.60.20from.20an.20.60AddrOf.60.20expr.3F.html#227374769">(Feb 23 2021 at 02:41)</a>:</h4>
<p>This is fine for this case, but we do expand the AST and HIR to hold the necessary <code>Span</code> as needed, but it's not a problem to synthesize <code>Span</code>s like you are in a limited manner.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>